﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<VideoCategoryInputModels>" %>

<%@ Import Namespace="SDT.Lib.Helpers" %>
<%@ Import Namespace="SDT.Lib.Paging" %>
<%@ Import Namespace="SDT.Admin.ViewModels" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Thêm chuyên mục
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
 <%if (ViewData["MessageInfo"] == null)
      { %>
    <% using (Html.BeginForm("Create", "VideoCategory", FormMethod.Post, new
       {
           id = "adminForm",
           enctype = "multipart/form-data"
       }))
       {%>
    <%= Html.ValidationSummary(true)%>
    <table class="admintable" width="100%">
        <tbody>
<%--            <tr>
                <td class="key">
                    Phân mục
                </td>
                <td>
                    <%=Html.TreeViewList("ParentID", Model.ListParentCategories, "-- Chuyên mục cha --", new { @class = "title" })%>
                </td>
            </tr>--%>
            <tr>
                <td class="key">
                    Tên chuyên mục (<font color="red">*</font>)
                </td>
                <td>
                    <%=Html.TextBox("Name", string.Empty, new { style = "width: 500px;", @class="required" })%>
                </td>
            </tr>
            <tr>
                <td class="key">
                    Tên viết tắt (<font color="red">*</font>)
                </td>
                <td>
                    <%=Html.TextBox("ShortName", string.Empty, new { style = "width: 500px;", @class="required" })%>
                </td>
            </tr>
            <tr>
                <td class="key">
                    Mô tả
                </td>
                <td>
                    <%=Html.TextArea("Description", new { cols = 90, rows = 20 })%>
                </td>
            </tr>
            <tr>
                <td class="key">
                    Thứ tự ưu tiên (<font color="red">*</font>)
                </td>
                <td>
                    <%=Html.TextBox("Priority", "1", new { style = "width: 50px; text-align: center;", @class = "required" })%>
                </td>
            </tr>
            <tr>
                <td class="key">
                    Trạng thái hiển thị
                </td>
                <td>
                    <%= Html.RadioButton("ActiveYN", true, new { @checked = "checked" })%>
                    Đăng tin
                    <%= Html.RadioButton("ActiveYN", false)%>
                    Không đăng
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <input type="submit" id="btnSave" value="Thêm mới"/>
                </td>
            </tr>
        </tbody>
    </table>
    <%}
      } %>

    <script type="text/javascript">
        $(document).ready(function() {
            $("#adminForm").validate();
        });       
        tinyMCE.init({
            mode: "exact",
            elements: "Description",
            theme: "advanced",
            plugins: "paste,imagemanager",
            theme_advanced_buttons1: "pastetext,separator,bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink,insertimage",
            theme_advanced_buttons2: "",
            theme_advanced_buttons3: "",
            theme_advanced_toolbar_location: "top",
            theme_advanced_toolbar_align: "left",
            theme_advanced_statusbar_location: "bottom",
            paste_use_dialog: false,
            paste_auto_cleanup_on_paste: true,
            paste_convert_headers_to_strong: false,
            paste_strip_class_attributes: "all",
            paste_remove_spans: true,
            paste_remove_styles: true
        });
    </script>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="Toolbar" runat="server">
    <td>
        <%= Html.Toolbar("Quay lại", "/VideoCategory", "back") %>
    </td>
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="Header" runat="server">
	Thêm chuyên mục
</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="Message" runat="server">
    <%=ViewData["MessageInfo"]!=null? "<p class='perror'>"+Html.Encode(ViewData["MessageInfo"])+"</p>":string.Empty%>
</asp:Content>
